namespace Xsxiaosa.Net
{
    using System;
    using System.IO;
//jyj add
	using System.Net.Sockets;

    internal class FtpDataUpload : FtpData
    {
        // Methods
        public FtpDataUpload(Ftp ftp, Stream stream) : base(ftp, stream, FtpTransferState.Uploading)
        {
        }

        protected override int DoTransfer()
        {
            int num1;
            if (this._ftpStream == null)
            {
                num1 = this._stream.Read(this._array, 0, 4096);
            }
            else
            {
                num1 = this._ftpStream.ReadInternal(this._array, 0, 4096);
            }
            if (num1 == 0)
            {
                return -1;
            }
            this._socket.Send(this._array, num1, SocketFlags.None);
            return num1;
        }

    }}

